package com.cqvip.innocence.project.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cqvip.innocence.project.model.entity.base.BaseModel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;


/**
 * @ClassName Admin
 * @Description
 * @Author Innocence
 * @Date 2020/7/11
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("admin")
@ApiModel(value="Admin对象", description="")
public class Admin extends BaseModel {

    private static final long serialVersionUID=1L;

    @TableField("name")
    @ApiModelProperty("用户名")
    private String name;

    @TableField("pass_word")
    @ApiModelProperty("密码")
    private String passWord;

    @TableField("salt")
    @ApiModelProperty(hidden = true)
    private String salt;

    @ApiModelProperty("是否锁定")
    @TableField("locked")
    private Boolean locked;

    @ApiModelProperty("头像url")
    @TableField("avatar")
    private String avatar;

    @ApiModelProperty("昵称")
    @TableField("nick_name")
    private String nickName;

    @ApiModelProperty("电话")
    @TableField("phone")
    private String phone;

    @ApiModelProperty("其他标注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty("角色id列表")
    @TableField(exist = false)
    private List<Long> roleIds;

    @ApiModelProperty(value = "最近登录时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "recent_time")
    private LocalDateTime recentTime;
}
